#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int longestContinuousSubstring(string s) {
        int max_length = 0;
        int left = 0, right = 1;
        int n = s.size();
        while (right < n)
        {
            char prev = s[right];
            //char cur = 
            if (s[right - 1] == s[right] - 1)
            {
                right++;
            }
            else
            {
                max_length = max_length > right - left ? max_length : right - left;
                left = right;
                right++;
            }
        }
        max_length = max_length > right - left ? max_length : right - left;
        return max_length;
    }
};